import { onMounted, ref } from 'vue'
import { getBannerAPI } from '@/apis/home'

export function useBanner() {
  // 二级分类轮播图
  const bannerList = ref([])
  // 获取banner数据
  const getBanner = async () => {
    const res = await getBannerAPI({
      distributionSite: '2'
    })
    // console.log(res)
    bannerList.value = res.result
  }
  onMounted(() => {
    getBanner()
  })

  return {
    bannerList
  }
}
